package com.borrowed.book.book.service;

import com.borrowed.book.book.Exception.UnderStockException;
import com.borrowed.book.book.domain.*;
import com.borrowed.book.system.domain.AjaxResult;
import org.springframework.stereotype.Service;

import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.util.List;
import java.util.Map;

public interface SBookService {
    //添加图书分组
    int insertGroup(SGroup record);

    //图书分组更新
    int updateGroup(SGroup record);

    //图书分组删除
    AjaxResult deleteGroup(Long id);

    //图书分组一览查询
    List<SGroup> selectGroupList();

    //添加图书标签
    int insertLabel(SLabel label);

    //删除图书标签
    AjaxResult deleteBookLabelRel(Long id);

    //标签一览
    List<SLabel> selectLabelList();

    //添加图书
    void addBook(SBook book);

    //修改图书
    void updateBookInfo(SBook book);

    //图书删除
    void deleteBookById(Long id);

    //图书批量删除
    void deleteBookByIds(CommonIds ids);

    //图书一览
    List<SelectBookOutDto> selectBookList(SelectBookInDto inDto) throws UnsupportedEncodingException;

    //根据id查询图书详细信息
    SelectBookOutDto selectBookDetailById(Long id);

    //根据isbn请求外部接口查询图书信息
    String selectIsbnBookInfo(String isbn) throws IOException;

    //isbn检查有没有录入过，有录入过，数量+1，没有录入过得返回标识
    String checkIsbnBookInfo(String isbn);
    //检查图书库存
    public SelectBookOutDto CheckBookRemaining(Long bookId) throws UnderStockException;

}
